const pets = [
  { gender: "男", name: "张三" },
  { gender: "女", name: "李四" },
  { gender: "男", name: "王五" },
  { gender: "女", name: "赵六" },
];
const inventory = [
  { name: "芦笋", type: "蔬菜", quantity: 5 },
  { name: "香蕉", type: "水果", quantity: 0 },
  { name: "山羊", type: "肉", quantity: 23 },
  { name: "樱桃", type: "水果", quantity: 5 },
  { name: "鱼", type: "肉", quantity: 22 },
];
const result = Object.groupBy(inventory, ({ type }) => type);

const res = Object.groupBy(pets, ({ gender }) => gender);
console.log(res, result);

console.log(Object.is(1, 1));

let record = {
  id: 1,
  name: "JavaScript",
  year: 2024,
};
console.log(record.name); // 输出: JavaScript
